package lombok;

import lombok.experimental.Accessors;
import org.junit.Test;

/**
 * @author
 * @Title: TestLombok
 * @Description:
 * @date 2022/5/17 11:46 上午
 */
public class TestLombok {

    /**
     * 使用 Student.builder().property... .build()这种方式构造对象
     */
    @Test
    public void test01(){
        Student student = Student.builder().name("lujieni").age(30).build();
        System.out.println(student);
    }

    @Test
    public void teset02(){
        Person person = new Person().setName("lujieni").setAge(30);
        System.out.println(person);
    }

}

@Data
@Builder
class Student{
    private String name;
    private Integer age;
}

@Data
@Accessors(chain = true)
class Person{
    private String name;
    private Integer age;
}
